package com.ssyc.gsk_teacher.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.makeramen.roundedimageview.RoundedImageView;
import com.ssyc.common.glide.ImageUtil;
import com.ssyc.gsk_teacher.R;
import com.ssyc.gsk_teacher.bean.ApplyInfo;

import java.util.List;

/**
 * 报名人数的数据模型
 * Created by Administrator on 2018/7/9 0009.
 */

public class ApplyRvAdapter extends BaseQuickAdapter<ApplyInfo.ListBean, BaseViewHolder> {
    private Context context;

    public ApplyRvAdapter(Context context, int layoutResId, @Nullable List<ApplyInfo.ListBean> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, ApplyInfo.ListBean item) {
        //头像
        RoundedImageView ivHead = helper.getView(R.id.iv_head);
        ImageUtil.displayImage(context, ivHead, item.getStuIcon());

        //姓名
        TextView tvName = helper.getView(R.id.tv_name);
        tvName.setText(item.getStuName());

        //班级
        TextView tvClass = helper.getView(R.id.tv_class);
        tvClass.setText(item.getClassName());

        //电话
        TextView tvTel = helper.getView(R.id.tv_tel);
        tvTel.setText(item.getStuMobile());
    }
}
